/**
 * Created by jaliu on 2015/2/13.
 */

/**
 * Define routes/RESTServices for users namespace
 * Version: v1.0
 */

//401: failed
//200: OK

module.exports = function (app) {
    var users = require('../../controllers/backoffice/backOffice-user-controller');
    logger.debug("load the backOffice-frontendUser-route module....");

    //获取小区列表
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/getAllCommunity', users.getAllCommunity);

    //搜索前端用户
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/searchFrontendUser/:communityObjId/:mobilePhone/:nickName/:isVUser/:isTalent/:userRole/:startDate/:endDate/:startPage/:pageSize',users.searchFrontendUser);

    //拉黑前端用户
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/putFrontendUserToBlackList/:userObjId',users.putFrontendUserToBlacklist);

    //查询是否为认证用户
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/getUserAuthenticationInfo/:communityObjId',users.getUserAuthenticationInfo);

    //设置/取消VUser
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/setCancelVUser/:userObjId/:communityObjId',users.setCancelVUser);
    //修改用户信息
    app.put('/rest/' + RESTFullServiceVersion + '/backoffice/user/updateUser/:userObjId', users.updateUser);

    //设置前端用户为达人
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/setCancelFrontendUserToTalent/:userObjId/:talentDesc/:type',users.setCancelFrontendUserAsTalent);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/searchMobile/:mobile',users.searchMobile);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getUserInfo',users.getUserInfoByFilter);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/addNumberGroup/:groupName',users.addNumberGroup);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getNumberGroup',users.getNumberGroup);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/updateNumberGroup/:groupId/:groupName',users.updateNumberGroup);

    app.delete('/rest/' + RESTFullServiceVersion + '/backoffice/user/deleteNumberGroup/:groupId', users.deleteNumberGroup);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getNumberGroupById/:groupId', users.getNumberGroupById);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getUser',users.getUserByFilter);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getUserInfoByCommunity',users.getUserInfoByCommunity);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/getNumberGroupByFilter', users.getNumberGroupByFilter);

};
